package com.soriya.nestlive.im.serializer;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import com.soriya.nestlive.im.constant.MessageType;

import java.io.IOException;
import java.lang.reflect.Type;

public class MessageTypeSerializer implements ObjectSerializer {
    @Override
    public void write(JSONSerializer jsonSerializer, Object object, Object name, Type type, int features) throws IOException {
        MessageType messageType = (MessageType) object;
        jsonSerializer.out.write(String.valueOf(messageType.getType()));
    }
}
